]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Fix sound-file support
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Sep 2021 13:40:05 +0000 (15:40 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 6 Oct 2021 17:39:01 +0000 (17:39 +0000)
When commit 25bfe99ed53b5b7 replaced the thin libcanberra wrapper
with the (then) new MetaSoundPlayer API, it missed that the latter
expects files as GFile instead of a file path.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1991>

js/ui/notificationDaemon.js

index 69137b1b2309856f58e1ba4cdd39f1c768e32293..954ce80687a3ee2f1fdf07c74f59b6c19b8c595c 100644 (file)
@@ -229,11 +229,16 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
         if (!gicon)
             gicon = this._fallbackIconForNotificationData(hints);
 
-        notification.update(summary, body, { gicon,
-                                             bannerMarkup: true,
-                                             clear: true,
-                                             soundFile: hints['sound-file'],
-                                             soundName: hints['sound-name'] });
+        const soundFile = 'sound-file' in hints
+            ? Gio.File.new_for_path(hints['sound-file']) : null;
+
+        notification.update(summary, body, {
+            gicon,
+            bannerMarkup: true,
+            clear: true,
+            soundFile,
+            soundName: hints['sound-name'],
+        });
 
         let hasDefaultAction = false;